perm filename DVITYP.CH[TEX,SYS]1 blob sn#729456 filedate 1983-10-30 generic text, type C, neo UTF8
COMMENT ⊗   VALID 00007 PAGES
C REC  PAGE   DESCRIPTION
C00001 00001
C00002 00002	@x Tell WEAVE to print only the changes:
C00003 00003	@x Specify compiler directives:
C00005 00004	@x Opening packed binary files:
C00007 00005	@x Set up terminal I/O:
C00009 00006	@x The default font directory:
C00011 00007	@x Change to file name conventions:
C00015 ENDMK
C⊗;
@x Tell WEAVE to print only the changes:
	\centerline{\hsize 5in\baselineskip9pt
		\vbox{\ninerm\noindent
		The preparation of this report
		was supported in part by the National Science
		Foundation under grants IST-8201926 and MCS-8300984,
		and by the System Development Foundation. `\TeX' is a
		trademark of the American Mathematical Society.}}}
@y
\centerline{(This listing shows the changes for {\sc WAITS} only)}}
\let\maybe=\iffalse
@z
@x Specify compiler directives:
@p program DVI_type(@!dvi_file,@!output);
@y
@p @t\4@>@{$D-,W+@} {no debugging overhead}
program DVI_type(@!dvi_file,@!output);
@z
@x Opening packed binary files:
@p procedure open_dvi_file; {prepares to read packed bytes in |dvi_file|}
begin reset(dvi_file);
cur_loc←0;
end;
@#
procedure open_tfm_file; {prepares to read packed bytes in |tfm_file|}
begin reset(tfm_file,cur_name);
end;
@y
@p procedure open_dvi_file; {prepares to read packed bytes in |dvi_file|}
begin reset(dvi_file,'','/B:8');
cur_loc←0;
end;
@#
procedure open_tfm_file; {prepares to read packed bytes in |tfm_file|}
begin reset(tfm_file,cur_name,'/B:8/O/N:9');
end;
@z
@x Set up terminal I/O:
and |term_out| for terminal output.
@↑system dependencies@>

@<Glob...@>=
@!buffer:array[0..terminal_line_length] of ASCII_code;
@!term_in:text_file; {the terminal, considered as an input file}
@!term_out:text_file; {the terminal, considered as an output file}
@y
and |term_out| for terminal output.
@↑system dependencies@>

@d term_in==tty
@d term_out==tty

@<Glob...@>=
@!buffer:array[0..terminal_line_length] of ASCII_code;
@z
@x The default font directory:
@d default_directory_name=='TeXfonts:' {change this to the correct name}
@d default_directory_name_length=9 {change this to the correct length}
@y
@d default_directory_name=='[TEX,SYS]' {change this to the correct name}
@d default_directory_name_length=9 {change this to the correct length}
@z
@x Change to file name conventions:
@ The string |cur_name| is supposed to be set to the external name of the
\.{TFM} file for the current font. This usually means that we need to
prepend the name of the default directory, and
to append the suffix `\.{.TFM}'. Furthermore, we change lower case letters
to upper case, since |cur_name| is a \PASCAL\ string.
@↑system dependencies@>

@<Move font name into the |cur_name| string@>=
for k←1 to name_length do cur_name[k]←' ';
if p=0 then
	begin for k←1 to default_directory_name_length do
		cur_name[k]←default_directory[k];
	r←default_directory_name_length;
	end
else r←0;
for k←font_name[nf] to font_name[nf+1]-1 do
	begin incr(r);
	if r+4>name_length then
		abort('DVItype capacity exceeded (max font name length=',
			name_length:1,')!');
@.DVItype capacity exceeded...@>
	if (names[k]≥"a")∧(names[k]≤"z") then
			cur_name[r]←xchr[names[k]-@'40]
	else cur_name[r]←xchr[names[k]];
	end;
cur_name[r+1]←'.'; cur_name[r+2]←'T'; cur_name[r+3]←'F'; cur_name[r+4]←'M'
@y
@ The string |cur_name| is supposed to be set to the external name of the
\.{TFM} file for the current font. This usually means that we need to
prepend the name of the default directory, and
to append the suffix `\.{.TFM}'. But at {\mc SAIL} we append the
directory name after the font name. And we compress `\.{oldenglish}' to
`\.{oldish}'.
@↑system dependencies@>

@<Move font name into the |cur_name| string@>=
for k←1 to name_length do cur_name[k]←' ';
r←0;
for k←font_name[nf]+p to font_name[nf+1]-1 do
    if (k≤font_name[f]+p+2)∨(k≥font_name[nf+1]-3) then
	begin incr(r);
	if r+4>name_length then
		abort('DVItype capacity exceeded (max font name length=',
			name_length:1,')!');
@.DVItype capacity exceeded...@>
	if (names[k]≥"a")∧(names[k]≤"z") then
			cur_name[r]←xchr[names[k]-@'40]
	else cur_name[r]←xchr[names[k]];
	end;
cur_name[r+1]←'.'; cur_name[r+2]←'T'; cur_name[r+3]←'F'; cur_name[r+4]←'M';
r←r+4;
if p=0 then for k←1 to default_directory_name_length do
	begin incr(r);
	if r>name_length then abort('Font name is too long!');
	cur_name[r]←default_directory[k];
	end
else for k←font_name[nf] to font_name[nf]+p-1 do
	begin incr(r);
	if r>name_length then abort('Font name is too long!');
	if (names[k]≥"a")∧(names[k]≤"z") then
			cur_name[r]←xchr[names[k]-@'40]
	else cur_name[r]←xchr[names[k]];
	end
@z